(0) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^1).


The TRS R consists of the following rules:

active(terms(N)) → mark(cons(recip(sqr(N)), terms(s(N))))
active(sqr(0)) → mark(0)
active(sqr(s(X))) → mark(s(add(sqr(X), dbl(X))))
active(dbl(0)) → mark(0)
active(dbl(s(X))) → mark(s(s(dbl(X))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(first(0, X)) → mark(nil)
active(first(s(X), cons(Y, Z))) → mark(cons(Y, first(X, Z)))
active(terms(X)) → terms(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(recip(X)) → recip(active(X))
active(sqr(X)) → sqr(active(X))
active(add(X1, X2)) → add(active(X1), X2)
active(add(X1, X2)) → add(X1, active(X2))
active(dbl(X)) → dbl(active(X))
active(first(X1, X2)) → first(active(X1), X2)
active(first(X1, X2)) → first(X1, active(X2))
terms(mark(X)) → mark(terms(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
recip(mark(X)) → mark(recip(X))
sqr(mark(X)) → mark(sqr(X))
add(mark(X1), X2) → mark(add(X1, X2))
add(X1, mark(X2)) → mark(add(X1, X2))
dbl(mark(X)) → mark(dbl(X))
first(mark(X1), X2) → mark(first(X1, X2))
first(X1, mark(X2)) → mark(first(X1, X2))
proper(terms(X)) → terms(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(recip(X)) → recip(proper(X))
proper(sqr(X)) → sqr(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(add(X1, X2)) → add(proper(X1), proper(X2))
proper(dbl(X)) → dbl(proper(X))
proper(first(X1, X2)) → first(proper(X1), proper(X2))
proper(nil) → ok(nil)
terms(ok(X)) → ok(terms(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
recip(ok(X)) → ok(recip(X))
sqr(ok(X)) → ok(sqr(X))
s(ok(X)) → ok(s(X))
add(ok(X1), ok(X2)) → ok(add(X1, X2))
dbl(ok(X)) → ok(dbl(X))
first(ok(X1), ok(X2)) → ok(first(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

Rewrite Strategy: INNERMOST

(1) NestedDefinedSymbolProof (BOTH BOUNDS(ID, ID) transformation)

The following defined symbols can occur below the 0th argument of top: proper, active
The following defined symbols can occur below the 0th argument of proper: proper, active
The following defined symbols can occur below the 0th argument of active: proper, active

Hence, the left-hand sides of the following rules are not basic-reachable and can be removed:
active(terms(N)) → mark(cons(recip(sqr(N)), terms(s(N))))
active(sqr(0)) → mark(0)
active(sqr(s(X))) → mark(s(add(sqr(X), dbl(X))))
active(dbl(0)) → mark(0)
active(dbl(s(X))) → mark(s(s(dbl(X))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(first(0, X)) → mark(nil)
active(first(s(X), cons(Y, Z))) → mark(cons(Y, first(X, Z)))
active(terms(X)) → terms(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(recip(X)) → recip(active(X))
active(sqr(X)) → sqr(active(X))
active(add(X1, X2)) → add(active(X1), X2)
active(add(X1, X2)) → add(X1, active(X2))
active(dbl(X)) → dbl(active(X))
active(first(X1, X2)) → first(active(X1), X2)
active(first(X1, X2)) → first(X1, active(X2))
proper(terms(X)) → terms(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(recip(X)) → recip(proper(X))
proper(sqr(X)) → sqr(proper(X))
proper(s(X)) → s(proper(X))
proper(add(X1, X2)) → add(proper(X1), proper(X2))
proper(dbl(X)) → dbl(proper(X))
proper(first(X1, X2)) → first(proper(X1), proper(X2))

(2) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^1).


The TRS R consists of the following rules:

sqr(ok(X)) → ok(sqr(X))
add(ok(X1), ok(X2)) → ok(add(X1, X2))
top(ok(X)) → top(active(X))
proper(nil) → ok(nil)
terms(ok(X)) → ok(terms(X))
dbl(mark(X)) → mark(dbl(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
first(ok(X1), ok(X2)) → ok(first(X1, X2))
terms(mark(X)) → mark(terms(X))
first(mark(X1), X2) → mark(first(X1, X2))
add(X1, mark(X2)) → mark(add(X1, X2))
s(ok(X)) → ok(s(X))
recip(ok(X)) → ok(recip(X))
recip(mark(X)) → mark(recip(X))
proper(0) → ok(0)
dbl(ok(X)) → ok(dbl(X))
first(X1, mark(X2)) → mark(first(X1, X2))
add(mark(X1), X2) → mark(add(X1, X2))
sqr(mark(X)) → mark(sqr(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
top(mark(X)) → top(proper(X))

Rewrite Strategy: INNERMOST

(3) CpxTrsMatchBoundsTAProof (EQUIVALENT transformation)

A linear upper bound on the runtime complexity of the TRS R could be shown with a Match-Bound[TAB_LEFTLINEAR,TAB_NONLEFTLINEAR] (for contructor-based start-terms) of 2.

The compatible tree automaton used to show the Match-Boundedness (for constructor-based start-terms) is represented by:
final states : [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
transitions:
ok0(0) → 0
active0(0) → 0
nil0() → 0
mark0(0) → 0
00() → 0
sqr0(0) → 1
add0(0, 0) → 2
top0(0) → 3
proper0(0) → 4
terms0(0) → 5
dbl0(0) → 6
cons0(0, 0) → 7
first0(0, 0) → 8
s0(0) → 9
recip0(0) → 10
sqr1(0) → 11
ok1(11) → 1
add1(0, 0) → 12
ok1(12) → 2
active1(0) → 13
top1(13) → 3
nil1() → 14
ok1(14) → 4
terms1(0) → 15
ok1(15) → 5
dbl1(0) → 16
mark1(16) → 6
cons1(0, 0) → 17
ok1(17) → 7
first1(0, 0) → 18
ok1(18) → 8
terms1(0) → 19
mark1(19) → 5
first1(0, 0) → 20
mark1(20) → 8
add1(0, 0) → 21
mark1(21) → 2
s1(0) → 22
ok1(22) → 9
recip1(0) → 23
ok1(23) → 10
recip1(0) → 24
mark1(24) → 10
01() → 25
ok1(25) → 4
dbl1(0) → 26
ok1(26) → 6
sqr1(0) → 27
mark1(27) → 1
cons1(0, 0) → 28
mark1(28) → 7
proper1(0) → 29
top1(29) → 3
ok1(11) → 11
ok1(11) → 27
ok1(12) → 12
ok1(12) → 21
ok1(14) → 29
ok1(15) → 15
ok1(15) → 19
mark1(16) → 16
mark1(16) → 26
ok1(17) → 17
ok1(17) → 28
ok1(18) → 18
ok1(18) → 20
mark1(19) → 15
mark1(19) → 19
mark1(20) → 18
mark1(20) → 20
mark1(21) → 12
mark1(21) → 21
ok1(22) → 22
ok1(23) → 23
ok1(23) → 24
mark1(24) → 23
mark1(24) → 24
ok1(25) → 29
ok1(26) → 16
ok1(26) → 26
mark1(27) → 11
mark1(27) → 27
mark1(28) → 17
mark1(28) → 28
active2(14) → 30
top2(30) → 3
active2(25) → 30

(4) BOUNDS(1, n^1)